package com.bsj.travel.exception;

import com.bsj.travel.def.global.JsonResultEnum;

/**
 * @author yinhao
 * @version 1.0
 * @description 自定义API异常
 * @date 2023/10/18
 */
public class ApiException extends RuntimeException{
    private JsonResultEnum status;

    public ApiException(JsonResultEnum status) {
        this.status = status;
    }


    public ApiException(JsonResultEnum status, String message) {
        super(message);
        status.setMsg(message);
        this.status = status;

    }

    public ApiException(JsonResultEnum status, String message, Throwable cause) {
        super(message, cause);
        this.status = status;
    }

    public JsonResultEnum getStatus() {
        return status;
    }
}
